Telegram Group & Telegram Channel
Выполнить строку - eval()

Говорят, каждый программист должен написать калькулятор. Но если вы python разработчик, то вы можете сделать это в одну строчку:
print(eval(input()))

Что за eval и почему это работает?
eval() создана чтобы выполнять выражения и функции, обязательно возвращая какой-то результат. Так можно облегчить написание кода, принимая строкой словари, списки.

Единственное, что не умеет eval - присваивать что-то переменным. Зато она может их использовать!

Правильное применение функции сильно упростит вам жизнь.



tg-me.com/itpythons/26
Create:
Last Update:

Выполнить строку - eval()

Говорят, каждый программист должен написать калькулятор. Но если вы python разработчик, то вы можете сделать это в одну строчку:

print(eval(input()))

Что за eval и почему это работает?
eval() создана чтобы выполнять выражения и функции, обязательно возвращая какой-то результат. Так можно облегчить написание кода, принимая строкой словари, списки.

Единственное, что не умеет eval - присваивать что-то переменным. Зато она может их использовать!

Правильное применение функции сильно упростит вам жизнь.

BY Python College | СФЕРА IT




Share with your friend now:
tg-me.com/itpythons/26

View MORE
Open in Telegram


Python College | СФЕРА IT Telegram | DID YOU KNOW?

Date: |

Dump Scam in Leaked Telegram Chat

A leaked Telegram discussion by 50 so-called crypto influencers has exposed the extraordinary steps they take in order to profit on the back off unsuspecting defi investors. According to a leaked screenshot of the chat, an elaborate plan to defraud defi investors using the worthless “$Few” tokens had been hatched. $Few tokens would be airdropped to some of the influencers who in turn promoted these to unsuspecting followers on Twitter.

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

Python College | СФЕРА IT from ua


Telegram Python College | СФЕРА IT
FROM USA